home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / patches / patchlibv4 / installpatchcx < prev    next >
Encoding:
Text File  |  1996-07-16  |  6.4 KB  |  315 lines

  1. ; -----------------------------------------------------------------------------
  2.  
  3. ; Source            : InstallPatchCX
  4. ; Project            : PatchCX
  5. ; Author            : Martin Hauner
  6. ; EMail                : drizzt@trashcan.mcnet.de
  7. ; Copyright            : Martin Hauner 1996
  8. ; Revision            : $Revision: 1.1 $
  9. ; Language            : Installer
  10. ; Remarks            : Tabsize - 4
  11. ; Remarks            :
  12. ; History            :
  13. ;
  14. ; 07.07'96            - started..
  15. ;
  16. ; -----------------------------------------------------------------------------
  17.  
  18.  
  19.  
  20. ; -----------------------------------------------------------------------------
  21. ;
  22. ; set strings according the @language variable.
  23. ;
  24.  
  25.     ; -------------------------------------------------------------------------
  26.     ;
  27.     ; english is the default language.
  28.     ;
  29.     ; -------------------------------------------------------------------------
  30.     ; misc strings.
  31.  
  32.     ( set #wrongversion.txt
  33.  
  34.         ( cat    "\n Attention!\n You have an old version of the program 'Installer'.\n"
  35.                 "The installation procedure needs at least Installer 42.9.\n\n"
  36.                 "Please update the Installer program.\n"
  37.         );endcat
  38.     );endset
  39.  
  40.  
  41.     ; -------------------------------------------------------------------------
  42.     ; strings for #dirPatchCX
  43.  
  44.     ( set #askdirPatchCX.txt
  45.  
  46.         ( cat    "Where do you like to install PatchCX? ( no directory will be created )"
  47.         );endcat
  48.     );endset
  49.  
  50.     ( set #askdirPatchCX.helptxt
  51.  
  52.         ( cat    "\nIf you choose the given directory, PatchCX gets started automatically "
  53.                 "during the boot process.\n\n"
  54.         );endcat
  55.     );endset
  56.  
  57.  
  58.  
  59.     ; -------------------------------------------------------------------------
  60.     ; strings for #dirFDfiles
  61.  
  62.     ( set #askdirFDfiles.txt
  63.  
  64.         ( cat    "Select the directory where you keep the fd files."
  65.         );endcat
  66.     );endset
  67.  
  68.     ( set #askdirFDfiles.helptxt
  69.  
  70.         ( cat    "\nRead the PatchCX.guide for more information about fd files.\n\n"
  71.         );endcat
  72.     );endset
  73.  
  74.  
  75.     ; -------------------------------------------------------------------------
  76.     ; strings for starting multiview with the PatchCX.guide
  77.  
  78.     ( set #startGuide.txt
  79.  
  80.         ( cat    "do you like to read the PatchCX.guide NOW?"
  81.         );endcat
  82.     );endset
  83.  
  84.     ( set #startGuide.helptxt
  85.  
  86.         ( cat    "\nSimple question, isn't it? Make your choice.\n\n"
  87.         );endcat
  88.     );endset
  89.  
  90.  
  91.     ; -------------------------------------------------------------------------
  92.     ; strings for selecting a dir for the guide file
  93.  
  94.     ( set #askdirGuide.txt
  95.  
  96.         ( cat    "Where do you like to install the PatchCX.guide?"
  97.         );endcat
  98.     );endset
  99.  
  100.     ( set #askdirGuide.helptxt
  101.  
  102.         ( cat    "\nThe directory will be stored in PatchCX' 'guidepath' tooltype "
  103.                 "( Allthough PatchCX doesn't use it so far ).\n"
  104.         );endcat
  105.     );endset
  106.  
  107.  
  108.     ; -------------------------------------------------------------------------
  109.     ; strings for copying PatchCX/PatchCX.info
  110.  
  111.     ( set #copyPatchCX.txt
  112.  
  113.         ( cat    "Copying PatchCX & PatchCX.info to %s ."
  114.         );endcat
  115.     );endset
  116.  
  117.  
  118.  
  119.     ; -------------------------------------------------------------------------
  120.     ; strings for copying PatchCX.guide/PatchCX.guide.info
  121.  
  122.     ( set #copyGuide.txt
  123.  
  124.         ( cat    "Copying PatchCX.guide to %s ."
  125.         );endcat
  126.     );endset
  127.  
  128.  
  129.  
  130.     ; -------------------------------------------------------------------------
  131.     ;
  132.     ; here follows an example, how to localize this script. We overwrite the
  133.     ; english strings with translated strings if we know the @language.
  134.     ;
  135.  
  136.     ; -------------------------------------------------------------------------
  137.     ;
  138.     ; deutsch
  139.     ;
  140.  
  141. ;    ( if ( = @language "deutsch" )
  142. ;    (;then
  143.  
  144. ;
  145. ;    Note:
  146. ;
  147. ;    insert here the above commands, which set the english text, and translate them.
  148. ;
  149.  
  150. ;
  151. ;    here is a small example for the german translation of  #wrongversion.txt
  152. ;
  153. ;        ( set #wrongversion.txt
  154. ;            ( cat    "\n Achtung!\n Sie haben ein alte Version des 'Installer'-Programms.\n"
  155. ;                    "Die Installation benötigt mindestens die Installer-Version 42.9.\n\n"
  156. ;                    "Bitte, erneuern Sie das Installer-Programm.\n"
  157. ;            );endcat
  158. ;        );endset
  159.  
  160. ;    );endthen
  161. ;    );endif
  162.  
  163.  
  164. ; -----------------------------------------------------------------------------
  165.  
  166.  
  167.  
  168.  
  169.  
  170. ; -----------------------------------------------------------------------------
  171. ;
  172. ; ask for the directory, where we should install something..
  173. ;
  174. ; notes:
  175. ; #dir is the result.
  176. ;
  177.  
  178. ( procedure mrh_askdir #default #prompt #help
  179.  
  180.     ( set #dir
  181.         ( askdir
  182.             ( default    #default )
  183.             ( prompt    #prompt )
  184.             ( help        ( cat #help @askdir-help ) )
  185.         );endaskbool
  186.     );endset
  187.  
  188. );endprocedure
  189.  
  190. ; -----------------------------------------------------------------------------
  191.  
  192.  
  193. ; -----------------------------------------------------------------------------
  194. ;
  195. ; open a guide with multiview.
  196. ;
  197. ; notes:
  198. ; #error is the result
  199. ;
  200.  
  201. ( procedure mrh_openguide #guide #prompt #help
  202.  
  203.     ( set #error
  204.         ( run    ( "sys:utilities/multiview %s" #guide )
  205.                 ( prompt #prompt )
  206.                 ( help   #help )
  207.                 ( confirm 1 )
  208.                 ( safe )
  209.          );endrun
  210.     );endset
  211.  
  212. );endprocedure
  213.  
  214. ; -----------------------------------------------------------------------------
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. ; -----------------------------------------------------------------------------
  235. ;
  236. ; main...
  237. ;
  238.  
  239. ( if ( > @installer-version 0 )
  240. (;then
  241.  
  242.     ; -------------------------------------------------------------------------
  243.     ; installer version is ok :-)
  244.  
  245.     ( complete 0 )
  246.  
  247.     ( set #dirPatchCX ( mrh_askdir "Sys:WBStartup" #askdirPatchCX.txt #askdirPatchCX.helptxt ) )
  248.  
  249.     ( complete 10 )
  250.  
  251.     ( set #dirFDfiles ( mrh_askdir "fd:"  #askdirFDfiles.txt #askdirFDfiles.helptxt ) )
  252.  
  253.     ( complete 20 )
  254.  
  255.     ( set #dirGuide ( mrh_askdir ""  #askdirGuide.txt #askdirGuide.helptxt ) )
  256.  
  257.     ( complete 30 )
  258.  
  259.     ( copyfiles
  260.         ( prompt    ( #copyPatchCX.txt #dirPatchCX ) )
  261.         ( help        @copyfiles-help )
  262.         ( source    "PatchCX" )
  263.         ( infos )
  264.         ( dest        #dirPatchCX )
  265.         ( files )
  266.         ;( confirm    1 )
  267.     );endcopyfiles
  268.  
  269.     ( complete 40 )
  270.  
  271.     ( copyfiles
  272.         ( prompt    ( #copyGuide.txt #dirGuide ) )
  273.         ( help        @copyfiles-help )
  274.         ( source    "PatchCX.guide" )
  275.         ( infos )
  276.         ( dest        #dirGuide )
  277.         ( files )
  278.         ;( confirm    1 )
  279.     );endcopyfiles
  280.  
  281.     ( complete 50 )
  282.  
  283.     ( tooltype
  284.         ( dest            ( tackon #dirPatchCX "PatchCX" ) )
  285.         ( settooltype    "fdpath" #dirFDfiles )
  286.         ( settooltype    "guidepath" ( tackon #dirGuide "PatchCX.guide" ) )
  287.         ( noposition )
  288.     );endtooltype
  289.  
  290.  
  291.     ( complete 60 )
  292.     ( complete 70 )
  293.     ( complete 80 )
  294.     ( complete 90 )
  295.  
  296.     ( mrh_openguide "PatchCX.guide" #startGuide.txt #startGuide.helptxt )
  297.  
  298.     ( complete 100 )
  299.  
  300.     ( set @default-dest #dirPatchCX )
  301.  
  302. );endthen
  303. (;else
  304.  
  305.     ; -------------------------------------------------------------------------
  306.     ; installer version is to old :-(
  307.  
  308.     ( message #wrongversion.txt )
  309.     ( exit (quiet) )
  310.  
  311. );endelse
  312. );endif
  313.  
  314. ; -----------------------------------------------------------------------------
  315.